package org.pih.javarosa.applogic;

import org.pih.javarosa.activity.drugList.DrugListController;
import org.pih.javarosa.activity.drugList.DrugListTransitions;
import org.pih.javarosa.util.AdultDosageUtil;

public class AdultDosageDrugListState implements DrugListTransitions{
	public void start() {
		DrugListController ctrl = new DrugListController();
		ctrl.setTransitions(this);
		ctrl.start();
	}

	public void back() {
		new AdultDosageCountryListState().start();
	}

	public void drugSelected(int id) {
		AdultDosageContext._().setDrugId(id);
		
		String formName = AdultDosageUtil.getDrugListData().get(new Integer(id)).getName();
		String protocolXFormPath = AdultDosageUtil.getDrugListData().get(new Integer(id)).getProtocolXFormPath();
		
		AdultDosageContext._().loadForm(formName, protocolXFormPath);
		
		Integer formId = AdultDosageContext._().getFormId(formName);
		
		new AdultDosageFormEntryState(formId).start();

	}
}
